package cn.wen.eeayjoke.adapter.home;

import java.util.List;

import cn.wen.base.adapter.recyclerview.QuickRecyclerViewHolder;
import cn.wen.base.adapter.recyclerview.QuickVAdapter;
import cn.wen.base.vlayout.layout.GridLayoutHelper;
import cn.wen.eeayjoke.R;
import cn.wen.eeayjoke.entity.bean.home.IndexTopicItems;
import cn.wen.eeayjoke.utils.ItemTypes;

/**
 * 首页管理集合，管理集合
 */

public class NavigationAdapter extends QuickVAdapter<IndexTopicItems> {
    public NavigationAdapter(List<IndexTopicItems> data) {
        setData(data);
        setLayoutHelper(new GridLayoutHelper(data.size()));
        setLayoutId(R.layout.main_category);
    }

    @Override
    protected void convert(QuickRecyclerViewHolder holder, IndexTopicItems item, int position) {
        holder.displayImage(R.id.iv_category, item.pic_path);
    }

    @Override
    public int getItemViewType(int position) {
        return ItemTypes.TYPE_CATEGORY;
    }
}
